]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Fix corner highlight
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 10 Sep 2011 01:41:39 +0000 (03:41 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 14 Sep 2011 19:26:58 +0000 (21:26 +0200)
The style of the top bar's corners is bound to the style of the
corresponding button; we used to hardcode this association, but
as the login mode does have a different layout, the button is now
determined programmatically.
Unfortunately, some containers take the text direction into account
when ordering their children, while some don't, so the current
code returned the wrong button in RTL locales.

https://bugzilla.gnome.org/show_bug.cgi?id=658983

js/ui/panel.js

index 57c5df4aa247045c173ed3fe13b511461af22c3d..b64a1b2242d4bd31e6f42da8560a7a72b2a8a3aa 100644 (file)
@@ -764,11 +764,21 @@ PanelCorner.prototype = {
     },
 
     _boxStyleChanged: function() {
-        let button;
+        let side = this._side;
+
+        let rtlAwareContainer = this._box instanceof St.BoxLayout;
+        if (rtlAwareContainer &&
+            this._box.get_direction() == St.TextDirection.RTL) {
+            if (this._side == St.Side.LEFT)
+                side = St.Side.RIGHT;
+            else if (this._side == St.Side.RIGHT)
+                side = St.Side.LEFT;
+        }
 
-        if (this._side == St.Side.LEFT)
+        let button;
+        if (side == St.Side.LEFT)
             button = this._findLeftmostButton(this._box);
-        else if (this._side == St.Side.RIGHT)
+        else if (side == St.Side.RIGHT)
             button = this._findRightmostButton(this._box);
 
         if (button) {